package com.dylan.channel.v5;

import java.nio.channels.SelectableChannel;

public abstract class MultiThreadEventLoopGroup extends MultiTreadEventExecutorGroup implements EventLoopGroup {

    public MultiThreadEventLoopGroup(int treads) {
        super(treads);
    }

    @Override
    protected abstract EventLoop newChild();

    @Override
    public EventLoop next() {
        return (EventLoop) super.next();
    }

    //这个方法是实现了EventLoopGroup接口中的同名方法
    @Override
    public void register(SelectableChannel channel) {
        next().register(channel);
    }
}
